package edu.sctu.practice.class02.mengyao.text04;

/**
 * Created by Administrator on 2015/10/12.
 */
public class Number {
    private int number1;
    private int number2;
    int resultOfSubtration = 0;
    float resultOfDivision;

    public Number(int number1, int number2) {
        this.number1 = number1;
        this.number2 = number2;


    }

    public void addition() {
        int resultOfAddition = number1 + number2;
        System.out.println(resultOfAddition);

    }

    public void multiplication() {
        int resultOfMultiplication = number1 * number2;
        System.out.println(resultOfMultiplication);

    }

    public void subtration() {
        if (number1 > number2) {

            resultOfSubtration = number1 - number2;
        } else {

            resultOfSubtration = number2 - number1;
        }
        System.out.println(resultOfSubtration);
    }

    public void division() {
        if (number1 != 0) {
            resultOfDivision = number1 / number2;
        } else {

            resultOfDivision = number2 / number1;
        }
        System.out.println(resultOfDivision);
    }

    public static void main(String[] args) {
        Number n = new Number(9, 4);
        n.addition();
        n.division();
        n.multiplication();
        n.subtration();
    }
}
